import Axios from "axios";
Axios.defaults.baseURL = "https://cn.apihz.cn/api";
Axios.defaults.timeout = 60000;
// Axios.defaults.baseURL = import.meta.env.DEV ? "/api" : "";
// res拦截器 响应拦截器
// https://cn.apihz.cn/api/xinwen/douyin.php?id=88888888&key=88888888
// id: 10008173,
// key: "db308d17616bb097565929d9b740fb15",
// req拦截器 请求拦截器
Axios.interceptors.request.use((config) => {
const params = config.params || {}
  config.params = {
    ...params,
    id: 10008173,
    key: "db308d17616bb097565929d9b740fb15",
  }
  return config;
});

Axios.interceptors.response.use((res) => {
    console.log(res);
    return res.data;
});

export default Axios;